﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace OMSService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IService1
    {
        // TODO: Add your service operations here
        #region Item
        [OperationContract]
        bool CreateItem(ItemModel item);

        [OperationContract]
        List<ItemModel> GetAllItems();

        [OperationContract]
        ItemModel GetItemById(int id);

        [OperationContract]
        bool EditItem(ItemModel itemModel);

        [OperationContract]
        bool DeleteItem(int id);

        #region Filters
        [OperationContract]
        List<ItemModel> FilterByName(string itemName);

        [OperationContract]
        List<ItemModel> FilterByDescription(string itemDesr);
        #endregion

        #endregion

        #region User
        [OperationContract]
        bool CreateUser(UserModel userModel);

        [OperationContract]
        List<UserModel> GetAllUsers();

        [OperationContract]
        UserModel GetUserById(int id);

        [OperationContract]
        UserModel GetUserByUserName(string userName);

        [OperationContract]
        bool EditUser(UserModel userModel);

        [OperationContract]
        bool DeleteUser(int id);

        [OperationContract]
        int CheckUserPass(string userName, string password);

        #region Filters

        [OperationContract]
        List<UserModel> FilterUsers(string field, string condition, string pattern);

        #endregion

        #endregion

        #region CreditCard
        [OperationContract]
        void CreateCreditCard(CreditCardModel cardModel);

        [OperationContract]
        List<CreditCardModel> GetAllCreditCards();

        [OperationContract]
        CreditCardModel GetCreditCardById(int id);

        [OperationContract]
        void EditCreditCard(CreditCardModel cardModel);

        [OperationContract]
        void DeleteCreditCard(int id);
        #endregion

        #region OrderItem
        [OperationContract]
        bool CreateOrderItem(OrderItemModel item);

        [OperationContract]
        List<OrderItemModel> GetAllOrderItems();

        [OperationContract]
        OrderItemModel GetOrderItemById(int id);

        [OperationContract]
        bool EditOrderItem(OrderItemModel itemModel);

        [OperationContract]
        bool DeleteOrderItem(int id);
        #endregion

        #region Order
        [OperationContract]
        int CreateOrder(OrderModel order);

        [OperationContract]
        OrderModel GetOrderById(int id);

        [OperationContract]
        bool EditOrder(OrderModel orderModel);

        [OperationContract]
        bool DeleteOrder(int id);

        [OperationContract]
        CreditCardModel GetCardByOrderId(int id);

        [OperationContract]
        bool AddOrderItemToOrder(int orderId, OrderItemModel orderItemModel);

        [OperationContract]
        List<OrderModel> GetAllOrders();

        [OperationContract]
        List<OrderModel> GetOrdersByCustomer(int userId);

        #region Filter

        [OperationContract]
        List<OrderModel> OrderFilter(string field, string pattern);

        #endregion
        #endregion

        #region Helpers

        [OperationContract]
        bool CreateSampleData();

        #endregion Helpers
    }

}
